myApp.factory('$serMaganerAdmin', function($localStorage, $resource){
	var setSend = function(data, url){
			data = data || {};
			url = admin_url + url;
			return $resource(url)
				.save(data)
				.$promise;
		};
	return {
		/*获取角色列表*/
		list: function(data){
			return setSend(data, 'WorkerRole/getList');
		},
		/*获取角色详情*/
		detail: function(data){
			return setSend(data, 'WorkerRole/getRoleDetail');
		},
		/*增加角色*/
		add: function(data){
			return setSend(data, 'WorkerRole/addRole');
		},
		/*编辑角色节点*/
		editorNode: function(data){
			return setSend(data, 'WorkerRole/saveRoleNode');
		},
		/*编辑角色信息*/
		editorRole: function(data){
			return setSend(data, 'WorkerRole/saveRole');
		},
		/*删除角色*/
		del: function(data){
			return setSend(data, 'WorkerRole/deleteRole');
		},
		/*禁用启用角色*/
		status: function(data){
			return setSend(data, 'WorkerRole/changeStatus');
		}
	}
});